<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="/WEB-INF/lib/spring.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="z" uri="/WEB-INF/lib/zerdoor.tld"%>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>


<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<c:set value="${artistHomeMap.artist}" var="artist" scope="page"/>
<c:set value="${artistHomeMap.finishProduction}" var="finishProduction" scope="page"/>
<c:set value="${artistHomeMap.salesProduction}" var="salesProduction" scope="page"/>
<c:set value="${artistHomeMap.appraiseInfo}" var="appraiseInfo" scope="page"/>
<c:set value="${artistHomeMap.countAppraise}" var="countAppraise" scope="page"/>
<c:set value="${artistHomeMap.inTaskInfo}" var="inTaskInfo" scope="page"/>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><spring:message code='artist_home.title.msg' /></title>
    <link href="${path}/style/acg/css/style.css" rel="stylesheet" type="text/css" />
    <script src="${path}/js/jquery.min.js" type="text/javascript"></script>
    <%--<script type="text/javascript" src="${path}/style/acg/js/common.js"></script>--%>

    <script type="text/javascript">
        //  收藏
        function f_favorite(){

            if("${curUser.userId}" == null || "${curUser.userId}" == ""){

                alert("<spring:message code='artist_home.alert.tipLogin' />");
                return;
            }

            $.post("${path}/favorite/addFavorite.html",{collectId:"${artist.artist_id}",type:124102},function(result){

                if(result != "error"){

                    $(".favoriteP").html("<a href='javascript:f_reFavorite(\""+result+"\")' class=\"sc\"><em class=\"ico_sc\"></em><spring:message code='artist_home.msg.unsubscribe' /></a>");


                }else{
                    alert("<spring:message code='artist_home.alert.favoriteFailure' />");
                }
            });
        }

        //  取消收藏
        function f_reFavorite(favoriteId){


            $.post("${path}/favorite/removeFavorite.html",{favoriteId:favoriteId,collectId:"${artist.artist_id}",type:124102},function(result){

                if(result != "error"){

                    $(".favoriteP").html("<a href=\"javascript:f_favorite();\" class=\"sc\"><em class=\"ico_sc\"></em><spring:message code='artist_home.msg.collect' /></a>");


                }else{
                    alert("<spring:message code='artist_home.alert.favoriteFailure' />");
                }
            });
        }
    </script>
</head>

<body>
<div class="header">
    <jsp:include page="../public/header.jsp">
        <jsp:param    name="home"    value="dddd"    />
    </jsp:include>
</div>

<div id="container">
    <div class="wrapper">
    	<div class="artleft">
        	<div class="artleft_toux clearfix">
            	<div class="touxiang clearfix">
                	<img src="${path}/${artist.head_portrait}" width="120" height="120" />
                    <div class="art_leftuser">
                    	<h3>${artist.real_name}</h3>
                        <c:if test="${artist.name_auth == 101001}">
                            <div class="shuxing"><span><spring:message code='artist_home.msg.verified' /></span></div>

                        </c:if>
                        <div class="gyw"><a href="${path}/employArtistTask/employArtistTask.html?artist_id=${artist.artist_id}" value="${artist.artist_id}"><spring:message code='artist_home.msg.hireMe' /></a></div>
                    </div>
                </div>
                <div class="clr"></div>
            </div>
            <div class="art_leftcontact clearfix">
                <a href="${path}/usercenter/toUserMessagesHome.html?sender=${artist.user_id}"><em class="ico_lx"></em><spring:message code='artist_home.msg.contactMe' /></a>
                <span class="favoriteP">

                    <c:set var="favoriteId" scope="page" value="${z:findFavorite(curUser.userId, artist.artist_id, 124102)}"></c:set>

                                <c:if test="${favoriteId == null}">
                                    <a href="javascript:f_favorite();" class="sc"><em class="ico_sc"></em><spring:message code='artist_home.msg.collect' /></a>
                                </c:if>

                                <c:if test="${favoriteId != null}">
                                    <a href='javascript:f_reFavorite("${favoriteId}")' class="sc"><em class="ico_sc"></em><spring:message code='artist_home.msg.unsubscribe' /></a>
                                </c:if>


                </span>

            </div>
            <div class="artleft_box">
            	<h1><spring:message code='artist_home.msg.ongoingProjects' /></h1>
                <ul>
                    <c:forEach var="bean" items="${inTaskInfo}">
                        <a href="${path}/taskdetail/index.html?taskId=${bean.item_id}">
                        <li class="first clearfix" item_id="${bean.item_id}">
                            <img src="${path}/${bean.item_front_cover}" width="105" height="65" />
                            <h3>${bean.title}</h3>
                            <p><spring:message code='artist_home.msg.hasBeen' />：${bean.days} <spring:message code='artist_home.msg.day' /></p>
                        </li>
                        </a>
                    </c:forEach>



                </ul>
            </div> 
            <div class="artleft_box">
            	<%--<h1>作品热销排行榜</h1>--%>
                <ul class="hotproduct">
                	<%--<li class="first clearfix">--%>
                    	<%--<img src="upload/1.jpg" width="105" height="65" />--%>
                        <%--<h3>项目名称项目名称项目名称项目名称项目名称项目名称</h3>--%>
                    <%--</li>--%>
                	<%--<li class="clearfix">--%>
                    	<%--<img src="upload/1.jpg" width="105" height="65" />--%>
                        <%--<h3>项目名称项目名称项目名称项目名称项目名称项目名称</h3>--%>
                    <%--</li>--%>
                	<%--<li class="clearfix">--%>
                    	<%--<img src="upload/1.jpg" width="105" height="65" />--%>
                        <%--<h3>项目名称项目名称项目名称项目名称项目名称项目名称</h3>--%>
                    <%--</li>--%>
                	<%--<li class="clearfix">--%>
                    	<%--<img src="upload/1.jpg" width="105" height="65" />--%>
                        <%--<h3>项目名称项目名称项目名称项目名称项目名称项目名称</h3>--%>
                    <%--</li>--%>
                	<%--<li class="clearfix">--%>
                    	<%--<img src="upload/1.jpg" width="105" height="65" />--%>
                        <%--<h3>项目名称项目名称项目名称项目名称项目名称项目名称</h3>--%>
                    <%--</li>--%>
                </ul>
            </div>
        </div>
        <div class="artrightbox">
        	<div class="artbasic">
                <div class="artbasic_name clearfix">
                    <strong>${artist.real_name}</strong>
                        <div class="shuxing">

                            <span>${artist.artist_level}</span>

                        </div>
                </div>
                <div class="artbasic_list">
                	<dl class="clearfix">
                    	<dt><spring:message code='artist_home.msg.services' />：</dt>
                        <dd>
                            <c:forEach items="${artist.service}" var="service">
                                <em>${service}</em>
                            </c:forEach>
                        </dd>
                    </dl>
                	<dl class="clearfix">
                    	<dt><spring:message code='artist_home.msg.recentEarnings' />：</dt>
                        <dd>
                            <em>￥${artist.successTotalPrice.totalPrice}</em>
                            <em>${artist.successTotalPrice.totalNum}<spring:message code='artist_home.msg.pen' /></em>
                        </dd>
                    </dl>
                	<dl class="clearfix">
                    	<dt><spring:message code='artist_home.msg.evaluationData' />：</dt>
                        <dd><em><spring:message code='artist_home.msg.favorableRate' /> ${artist.appraise.positive}%</em>
                            <em><spring:message code='artist_home.msg.averageRate' /> ${artist.appraise.moderate}%</em>
                            <em><spring:message code='artist_home.msg.poorRate' /> ${artist.appraise.negative}%</em>
                            <em><spring:message code='artist_home.msg.overallRating' /> ${artist.appraise.comScore}</em>
                        </dd>
                    </dl>
                	<dl class="clearfix">
                    	<dt><spring:message code='artist_home.msg.profile' />：</dt>
                        <dd>${artist.intro_simplify}</dd>
                    </dl>
                </div>
            </div>
            <div class="artright_border">
            	<div class="member_title"><spring:message code='artist_home.msg.completedWorks' /><span><a href="${path}/productionList/productionList.html"><spring:message code='artist_home.msg.allWorks' /></a></span></div>
                <div class="artsellpro">
                	<ul class="clearfix">

                        <c:forEach items="${finishProduction}" var="finishPro">
                            <li works_id="${finishPro.works_id}">
                                <a href="${path}/artistPersonalHome/browseProduction.html?production_id=${finishPro.works_id}"><img src="${path}/${finishPro.cover}" width="292" height="180" /></a>
                                <div class="txt">
                                    <h3><a href="${path}/artistPersonalHome/browseProduction.html?production_id=${finishPro.works_id}">${finishPro.works_name}</a></h3>
                                    <p><spring:message code='artist_home.msg.price' />：￥${finishPro.price}<span  class="overtime"><spring:message code='artist_home.msg.completionTime' />：${finishPro.finishDays} <spring:message code='artist_home.msg.daysAgo' /></span></p>
                                </div>
                            </li>
                        </c:forEach>

                    </ul>
                </div>
            </div>
            <div class="artright_border">
            	<div class="member_title"><spring:message code='artist_home.msg.soldWorks' /><span><a href="${path}/productionList/productionList.html"><spring:message code='artist_home.msg.allWorks' /></a></span></div>
                <div class="artsellpro">
                	<ul class="clearfix">

                        <c:forEach items="${salesProduction}" var="salesPro">
                            <li works_id="${salesPro.works_id}">
                                <a href="${path}/artistPersonalHome/browseProduction.html?production_id=${salesPro.works_id}"><img src="${path}/${salesPro.cover}" width="292" height="180" /></a>
                                <div class="txt">
                                    <h3><a href="${path}/artistPersonalHome/browseProduction.html?production_id=${salesPro.works_id}">${salesPro.works_name}</a></h3>
                                    <p><span class="price">￥${salesPro.price}</span><span  class="more"><a href="${path}/artistPersonalHome/browseProduction.html?production_id=${salesPro.works_id}"><spring:message code='artist_home.msg.learnMore' /></a></span></p>
                                </div>
                            </li>
                        </c:forEach>

                    </ul>
                </div>
            </div>
            <div class="artright_border">
            	<div class="member_title"><spring:message code='artist_home.msg.artistEvaluation' />
                    <%--<span><a href=""><spring:message code='artist_home.msg.viewAll' /></a></span>--%>
                </div>
                <div class="art_common">
                	<div class="art_common_tit">
                    	<a href="javascript:void(0)" class="hover"><spring:message code='artist_home.msg.recentEvaluation' /></a>
                        <%--<a href="">所有评价</a>--%>
                        <span><spring:message code='artist_home.msg.FavorableComment' />：${countAppraise.positive}  <spring:message code='artist_home.msg.average' />：${countAppraise.moderate}  <spring:message code='artist_home.msg.negativeRatings' />：${countAppraise.negative}  </span>
                    </div>
                    <div class="art_common_list">
                    	<ul>

                            <c:forEach items="${appraiseInfo}" var="appraise">
                                <li class="clearfix">
                                    <dl class="clearfix">
                                        <dt><img src="${path}/${appraise.head_portrait}" width="120" height="120" /><p>${appraise.nickname}</p></dt>
                                        <dd>
                                            <h3>${appraise.title}<span>${appraise.appraise_time}</span></h3>
                                            <div class="intro">
                                                    ${appraise.content}
                                            </div>
                                        </dd>
                                    </dl>
                                </li>

                            </c:forEach>

                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="clr"></div>
    </div>
</div>
<div id="footer">
    <!--content-->
    <jsp:include page="../public/footer.jsp"></jsp:include>
</div>

</body>
</html>
